package com.topcent.tioxyc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.topcent.tioxyc.pojo.*;
import com.topcent.tioxyc.pojo.vo.CustomerInfoVO;
import com.topcent.tioxyc.pojo.vo.CustomerStatistics;
import com.topcent.tioxyc.pojo.vo.GameRecord;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author: weidian
 * @date: 2024/10/12 11:37
 * @Description: ${description}
 */
public interface Yy1KpiMapper extends BaseMapper<YY1_KPI> {
    int insertSaleOrder001(SalesOrder salesOrder);

    int insertSalesDocument(YY1_KPI y);

    int couselectCount(String ID);

    void truncateTable();

    void truncateTableOfSaleOrder001();

    List<SalesReport> getSalesDeliveryReport();

    List<SalesReport> getSalesOrderReport();

    List<MonthlyCustomerStatistics> get_monthly_customer_statistics();

    List<DeliveryData> getLatestDeliveryData();

    List<CustomerInfoVO> getCustomerInfoWithSAP();

    List<CustomerStatistics> getCustomerStatistics();

    CustomerOrderSummary selectByAddressSearchTermAndCreationDate(@Param("SalesDocument") String addressSearchTerm2, @Param("creationDate") String creationDate);

    Double SUMConditionAmount(@Param("addressSearchTerm2") String addressSearchTerm2);

    Double selectByAddressSearchTermAndCreationDate2(@Param("addressSearchTerm2") String addressSearchTerm2, @Param("kaishi") String kaishi,@Param("end")String end);
    List<CustomerOrderSummary> selectByAddressSearchTermAndCreationDate3(@Param("addressSearchTerm2") String addressSearchTerm2, @Param("kaishi") String kaishi);
    String chayewu(@Param("addressSearchTerm2") String addressSearchTerm2);

    String setJIan(@Param("code") String code);

    List<YY1_KPI> selectKPIName();

    // 插入新的游戏记录
    void insertGameRecord(GameRecord gameRecord);

    // 根据玩家ID查询游戏记录
    BigDecimal getLatestBalance(Integer playerId);

    // 查询YY1_KPI表中所有数据
    List<YY1_KPI> selectAll();

    // 查询YY1_KPI表中销售订单-物料数据
    List<YY1_KPI> selectOrderM();

    // 查询YY1_KPI表中25-06以后的数据
    List<YY1_KPI> selectAfterJune();

    // 查询DeliveryDocuments表中所有数据
    List<DeliveryDocumentsEntity> selecDeliveryDocumentsDatatAll();

    // 查询DeliveryDocuments表中过账日期不为空数据
    List<DeliveryDocumentsEntity> selectDeliveryDocumentsDateIsNotNull();

    // 查询DeliveryDocuments表中25-06以后的数据
    List<DeliveryDocumentsEntity> selecDeliveryDocumentsDatatAfterJune();

    // 查询ZZ_PurchaseOrderList表中所有数据
    List<PurchaseOrderList> selectPurchaseOrderAll();

    // 查询ZZ_PurchaseOrderList表中指定数据
    List<PurchaseOrderList> selectPurchaseOrderRate();

    /**
     * 批量插入销售订单明细（含时间戳字段）
     */
    int batchInsert(List<SalesOrderSql> salesOrderList);

    void truncateSalesOrderDetailsTable();

    int insertSalesDeliveryData(SalesDeliveryData salesDeliveryData);

    void truncateinsertSalesDeliveryData();

}